<template>
    <view>
		<view class="small-my-wallet-balance-info-box" v-for="(item,index) in balanceList" :key='index'>
			<view class="row row-between-wrapper">
				<view>佣金结算：  <text class="order-color">SP2019111811588865</text></view>
				<view class="icon-color">{{item.money}}</view>
			</view>
			<view class="row row-between-wrapper">
				<view class="order-color">{{item.createdTime}}</view>
				<view>余额：  <text>{{item.balance}}</text></view>
			</view>
		</view>
    </view>
</template>

<script>
	import http from '../../api/api.js';
    export default {
        data: function () {
            return {
				userId:uni.getStorageSync('userId'),
				balanceList:[],
				flag:false,
				pageNo:1
            }
        },
		onReachBottom(){
			if(this.flag) {
				this.pageNo++;
				this.init({pageNo:this.pageNo,userId:this.userId})
			}
		},
		onLoad(){
			this.init({pageNo:this.pageNo,userId:this.userId})
		},
        methods:{
			init(data){
				http.getBalanceList(data).then(res => {
					if(res.data.code === 1) {
						let len = res.data.data.length;
						if(len < 10) {
							this.flag = false
						}else{
							this.flag = true
						}
						this.balanceList.push.apply(this.balanceList,res.data.data);
					}
				})
			}
        }
    }
</script>

<style lang="scss" scoped>
	@import '../../common/mixins';
	.small-my-wallet-balance-info-box {
		@include box;
		padding-top: 20upx;
		padding-bottom: 20upx;
	}
	.order-color{
		color: #ADADAD;
	}
</style>
